//
//  NavigationTitle.m
//  FingerChinese
//
//  Created by luar on 21/02/2010.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "NavigationTitle.h"

@implementation NavigationTitle

@synthesize isFingerPage;

- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        // Initialization code
		hl = [[UIImageView alloc] initWithImage: 
						   [UIImage imageNamed:@"menu_highlight.png"]];
		hl.center = CGPointMake(frame.size.width/2, hl.center.y);
		hl.alpha = 0;
		[self addSubview:hl];
		title = [[[UILabel alloc] initWithFrame:frame] autorelease];
		title.backgroundColor = [UIColor clearColor];
		title.textAlignment = UITextAlignmentCenter;
		title.shadowColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.35];
		title.textColor = [UIColor whiteColor];
		title.font = [UIFont boldSystemFontOfSize:20];
		[self addSubview:title];
    }
    return self;
}

- (void)setTitle:(NSString *)str {
	title.text = str;
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
	[[NSNotificationCenter defaultCenter] postNotificationName:@"NavigationTitleTouch" object:self];
	hl.alpha = 1;
	[UIView beginAnimations:nil context:nil];
	[UIView setAnimationDuration:0.3];
	hl.alpha = 0;
	[UIView commitAnimations];
}

- (void)dealloc {
	[title dealloc];
    [super dealloc];
}


@end
